package com.nami.message.domain.service.impl;


import com.nami.message.domain.model.pmsg.PChatMsgModel;
import com.nami.message.domain.service.PrivateMessageDomainService;
import com.nami.message.domain.repository.InBoxRepository;
import com.nami.message.domain.repository.PrivateHisMsgRepository;
import com.nami.message.domain.repository.SendBoxRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class PrivateMessageDomainImpl implements PrivateMessageDomainService {

    private final InBoxRepository inBoxRepository;
    private final SendBoxRepository sendBoxRepository;
    private final PrivateHisMsgRepository privateHisMsgRepository;

    @Override
    public void processReceivedMessage(PChatMsgModel msgModel) {
        sendBoxRepository.add(msgModel);
        inBoxRepository.add(msgModel);
        privateHisMsgRepository.add(msgModel);
    }

}
